package cn.yuhh.service;

import cn.yuhh.mapper.CategoryMapper;
import cn.yuhh.pojo.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryService {

    @Autowired
    private CategoryMapper categoryMapper;

    public List<Category> queryCategoriesByPid(Long pid) {
        Category category = new Category();

        //设置商品的父级分类ID,进行查询
        category.setParentId(pid);
        return this.categoryMapper.select(category);
    }
}
